<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateGoodsImageTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('good_image', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('good_id')->comment('商品ID');
            $table->string('image')->comment('图片');
            $table->unsignedSmallInteger('sort')->default(0)->comment('排序');
            $table->timestampsTz();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('good_image');
    }
}
